
@extends('layout.default')

@section('layout.breadcrumb')
  <div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">      
    <div class="dataTables_paginate paging_bootstrap">      
      {{$shops->links()}}
    </div>
    <div class="form-group">
      <div class="input-group" style="width:350px;">
          <input type="text" class="form-control" id="acco" name="acco" maxlength="13" placeholder="门店名/核销员/对接人" autocomplete="off" value="">
          <span class="input-group-btn">
            <button class="btn btn-primary" id="btn-sign" type="submit" style="height:34px;">
            <i class="ace-icon fa fa-search"></i> 查询
            </button>
            <a class="btn btn-inverse create-shop" style="height:34px;">
              <i class="ace-icon fa fa-leaf"></i> 新增
            </a>
          </span>
      </div>
    </div>
  </div>
@stop

@section('layout.content') 

<div class="row">
  @foreach($shops as $shop)
  <div class="col-xs-6 col-sm-4 col-md-4 col-lg-1-5">
    
    <div class="thumbnail search-thumbnail shops-status-{{$shop->status}}" data-id="">
      
      <div class="thumb">
        <img class="img-responsive lazy" src="/assets/images/placehoder.png" data-original="{{$shop->cover_pic}}" />
      </div>

      <div class="caption">        
        <div class="content-line" >
          <a href="" class="shop-title">{!! $shop->present()->shopTrade !!} {{$shop->name}}</a>
        </div>
        <div class="content-line coupon-tags">
          <span class="coupon coupon-type-2">{{ $shop->category->parent->name }}</span>
          <span class="coupon coupon-type-3">{{ $shop->category->name }}</span>
          <span class="grey number align-middle coupon-effective">{{ $shop->branch->name }}</span>
        </div>        
        
        <div class="shops">
          <div class="shops-lf">
            <span class="shops-price bigger-120">￥128.0</span>
          </div>
          <div class="shops-rf">
            <span class="grey smaller-80">销量 </span>
            <span class="grey smaller-80 b">23</span>
          </div>
        </div>
        
        <div class="shops">
          <div class="shops-lf">
            <span class="green">提现</span>
            <span class="green">10823.7</span>
          </div>
          <div class="shops-rf number">            
            <span class="coupon coupon-scope-4 bigger-120">{{ $shop->member->mobile }}</span>
          </div>
        </div>
        
        <div class="shops">
            <div class="btn-group dropup" style="width:180px;">
              <a href="javascript:;" data-toggle="dropdown" class="btn-link btn-dropdown dropdown-toggle" style="text-decoration: none;">
                {!! $shop->present()->shopProgressLabel !!}
              </a>
              <ul class="dropdown-menu dropdown-light dropdown-caret dropdown-close">
                <li>
                  <a href="javascript:;">
                    <span class="grey"><i class="iconfont bigger-120" data-id="{{ $shop->id }}">&#xe995;</i>
                    合作洽谈</span>
                  </a>
                </li>
                <li>
                  <a href="javascript:;">
                    <span class="blue"><i class="iconfont bigger-120" data-id="{{ $shop->id }}">&#xe984;</i>
                    合同已签</span>
                  </a>
                </li>
                <li>
                  <a href="javascript:;">
                    <span class="red"><i class="iconfont bigger-120" data-id="{{ $shop->id }}">&#xe99b;</i>
                    文案完成</span>
                  </a>
                </li>
                <li>
                  <a href="javascript:;">
                    <span class="brown"><i class="iconfont bigger-120" data-id="{{ $shop->id }}">&#xe99e;</i>
                    产品制作</span>
                  </a>
                </li>
                <li class="divider"></li>
                <li>
                  <a href="javascript:;">
                    <span class="green"><i class="ace-icon fa fa-check" data-id="{{ $shop->id }}"></i>
                    门店上线</span>
                  </a>
                </li>

              </ul>
            </div>
            <div class="btn-group dropup" style="margin-top:2px;">
              <a href="javascript:;" data-toggle="dropdown" class="btn-link btn-dropdown dropdown-toggle">
                {!! $shop->present()->shopStatus !!}
              </a>
              <ul class="dropdown-menu dropdown-light dropdown-menu-right dropdown-caret dropdown-close">                
                <li>
                  <a href="javascript:;">
                    <span class="blue"><i class="ace-icon fa fa-edit" data-id="{{ $shop->id }}"></i></span>
                    编辑
                  </a>
                </li>
                <li class="divider"></li>
                <li>
                  <a href="javascript:;">
                    <span class="green"><i class="ace-icon fa fa-circle status" data-id="{{ $shop->id }}"></i>
                    正常</span>
                  </a>
                </li>
                <li>
                  <a href="javascript:;">
                    <span class="blue"><i class="ace-icon fa fa-play status" data-id="{{ $shop->id }}"></i>
                    审核中</span>
                  </a>
                </li>
                <li>
                  <a href="javascript:;">
                    <span class="red"><i class="ace-icon fa fa-close status" data-id="{{ $shop->id }}"></i>
                    审核失败</span>
                  </a>
                </li>
                <li class="divider"></li>
                <li>
                  <a href="javascript:;">
                    <span class="grey"><i class="ace-icon fa fa-circle status" data-id="{{ $shop->id }}"></i>
                    关闭</span>
                  </a>
                </li>

              </ul>
            </div>
        </div>                 
      </div>

    </div>

  </div>
  @endforeach
</div>


<div class="row">
  <div class="col-xs-12">
    <div class="dataTables_paginate paging_bootstrap">      
      {{$shops->links()}}
    </div>
  </div>
</div>
@stop

@section('javascript')
<script src="//cdn.bootcdn.net/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>
<script type="text/javascript">

  $(function() {

    $('.create-shop').on('click', function() {
      var uri = '{{route("merchant.shop.create")}}';
      layer.open({
          type: 2,
          title: '新增门店',
          area: ['960px', '580px'],
          shade: 0.8,
          content: uri,
        });      
    });

    $("img.lazy").lazyload({
      placehoder: "/assets/images/placehoder.png",
      effect: "fadeIn"
    });
    
  });

</script>
@stop